package com.syn.synold4s.adapter;

import android.content.Context;
import com.gaoyi.basemodule.baseAdapter.BaseAdapter;
import com.gaoyi.basemodule.baseAdapter.BaseViewHolder;
import com.gaoyi.basemodule.baseUtil.ImageUtil;
import com.gaoyi.basemodule.baseUtil.OKHttpUtil;
import com.syn.synold4s.R;
import com.syn.synold4s.bean.dto.ProjectSelectionDto;
import com.syn.synold4s.databinding.ItemProjectLayoutBinding;

public class ProjectAdapter extends BaseAdapter<ItemProjectLayoutBinding, ProjectSelectionDto> {
    public ProjectAdapter(Context context) {
        super(context);
    }

    @Override
    protected void setBindingVariable(ItemProjectLayoutBinding binding, int position) {

    }

    @Override
    protected void onBindItem(ItemProjectLayoutBinding binding, ProjectSelectionDto item, int position) {
        ImageUtil.loadImg(binding.iv, OKHttpUtil.IMG_URL + item.getPhoto(), R.drawable.error_img);
        binding.tvName.setText(item.getName());
        binding.tvLocation.setText(mContext.getString(R.string.location_) + item.getAddress());
    }

    @Override
    protected void onCreateView(ItemProjectLayoutBinding binding, BaseViewHolder<ItemProjectLayoutBinding> holder) {

    }

    @Override
    protected int getLayoutResId() {
        return R.layout.item_project_layout;
    }
}
